package org.swim.web.servlet.consts;

import net.sf.json.JsonConfig;

import org.swim.web.utils.JsonUtils;

public class ProfileAttr {

	public static String WHO = "who";

	public static class AbilityAttr {
		public static String ABILITY_ID = "id";
		public static String ABILITY_NAME = "name";
	}

	public static class UserAttr {
		public static String USER_ID = "id";
		public static String NAME = "name";
		public static String SURNAME = "surname";
		public static String EMAIL = "email";
		public static String EMAIL_CHECK = "emailCheck";
		public static String PASSWORD = "password";
		public static String PASSWORD_CHECK = "confirmPassword";
	}

	public static JsonConfig USER_JSONCFG;
	public static JsonConfig ABILITY_JSONCFG;

	static {
		USER_JSONCFG = JsonUtils.createJsonParamsFilter(UserAttr.USER_ID,
				UserAttr.NAME, UserAttr.SURNAME, UserAttr.PASSWORD,
				UserAttr.EMAIL_CHECK, UserAttr.EMAIL, UserAttr.PASSWORD_CHECK);

		USER_JSONCFG.registerJsonValueProcessor(String[].class,
				JsonUtils.getJvpStringArrToString());

		ABILITY_JSONCFG = JsonUtils.createJsonParamsFilter(
				AbilityAttr.ABILITY_ID, AbilityAttr.ABILITY_NAME);

		ABILITY_JSONCFG.registerJsonValueProcessor(String[].class,
				JsonUtils.getJvpStringArrToString());

	}

}